package com.xuhai.blog.api;

import com.xuhai.blog.admin.entity.ArticleEntity;
import com.xuhai.blog.admin.service.ArticleService;
import com.xuhai.blog.common.util.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author PangJunjie
 * @Date 2022/2/15/015
 */
@RestController
@RequestMapping("/api/article")
public class ApiArticleController {
    @Autowired
    private ArticleService articleService;

    @GetMapping("/page/{page}")
    public ResultJson page(@PathVariable Integer page){
        ArticleEntity article=new ArticleEntity();
        article.setStatus(1);
        return ResultJson.ok().data(articleService.getPage(page,5,article));
    }

}
